<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var html = document.querySelector("html");

      var text = [
        "富强",
        "民主",
        "文明",
        "和谐",
        "自由",
        "平等",
        "公正",
        "法治",
        "爱国",
        "敬业",
        "诚信",
        "友善",
        "❤",
      ];
      html.onclick = function (e) {
        var span = document.createElement("span");
        span.innerText = text[Math.floor(Math.random() * text.length)];
        span.style.color = rand();
        span.style.fontSize = "20px";
        span.style.position = "absolute";
        span.style.left = e.clientX - 10 + "px";
        span.style.top = e.clientY - 10 + "px";
        document.body.appendChild(span);
      };

      function rand() {
        var r = Math.random() * 255;
        var g = Math.random() * 255;
        var b = Math.random() * 255;
        return "rgb(" + r + "," + g + "," + b + ")";
      }
    </script>
  </body>
</html>
